﻿
@using Volo.Abp.UI.Navigation

@using Volo.Abp.AspNetCore.Mvc.UI.Theme.SB
@model IHasMenuItems

@foreach (var menuItem in Model.Items)
{
    var elementId = string.IsNullOrEmpty(menuItem.ElementId) ? string.Empty : $"id=\"{menuItem.ElementId}\"";
    var cssClass = string.IsNullOrEmpty(menuItem.CssClass) ? string.Empty : menuItem.CssClass;
    var disabled = menuItem.IsDisabled ? "disabled" : string.Empty;
    var isGroup = menuItem.CustomData != null && menuItem.CustomData.ToString() == SBThemeConstant.MENU_GROUP_NAME ? true : false;


    if (isGroup == true)
    {
        <!-- Divider -->
        <hr class="sidebar-divider">

        <!-- Heading -->
        <div class="sidebar-heading">
            @menuItem.DisplayName
        </div>

        @await Html.PartialAsync("~/Themes/SB/Components/Menu/Default.cshtml", menuItem)
    }
    else
    {
        if (Model as ApplicationMenu != null && Model.Items.IndexOf(menuItem) == 0)
        {
            <!-- Divider -->
            <hr class="sidebar-divider my-0">
        }
        @await Html.PartialAsync("~/Themes/SB/Components/Menu/_MenuItem.cshtml", menuItem)
    }
}